package org.example.backend.demos.web.ManagementModule.entity;

import jakarta.servlet.annotation.MultipartConfig;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.io.Serializable;

/**
 * 项目表(Project)实体类
 *
 * @author makejava
 * @since 2025-09-08 14:59:03
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Project implements Serializable {
    private static final long serialVersionUID = -69958541447930457L;
    /**
     * 主键ID
     */
    private Long id;
    /**
     * 项目标题
     */
    private String title;
    /**
     * 项目描述
     */
    private String description;
    /**
     * 项目详情内容
     */
    private String content;
    /**
     * 状态(0:下架,1:上架)
     */
    private Integer status;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 用户ID
     */
    private Long user_id;

    public Project(Builder builder) {
        this.id = builder.id;
        this.title = builder.title;
        this.description = builder.description;
        this.content = builder.content;
        this.status = builder.status;
        this.createTime = builder.createTime;
        this.updateTime = builder.updateTime;
        this.user_id = builder.user_id;
    }


    // 构建Builder
    public static final class Builder {
        private Long id;
        private String title;
        private String description;
        private String content;
        private Integer status;
        private Date createTime;
        private Date updateTime;
        private Long user_id;

        public Builder id(Long id) {
            this.id = id;
            return this;
        }

        public Builder title(String title) {
            this.title = title;
            return this;
        }

        public Builder description(String description) {
            this.description = description;
            return this;
        }

        public Builder content(String content) {
            this.content = content;
            return this;
        }

        public Builder status(Integer status) {
            this.status = status;
            return this;
        }

        public Builder createTime(Date createTime) {
            this.createTime = createTime;
            return this;
        }

        public Builder updateTime(Date updateTime) {
            this.updateTime = updateTime;
            return this;
        }

        public Builder user_id(Long user_id) {
            this.user_id = user_id;
            return this;
        }


        public Project build() {
            return new Project(this);
        }

    }


}

